﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterAdmin.master" CodeFile="Automovel.aspx.cs" Inherits="AreaRestrita_Automovel" %>

<asp:Content ID="Content2" ContentPlaceHolderID="cphTitulo" runat="server">
    <div class="myformGrid"> <h1>Lista de Automoveis</h1></div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphPagina" runat="server">
    <asp:ScriptManager ID="sm1" runat="server">
</asp:ScriptManager>
    <asp:UpdatePanel ID="upAutomovel" Visible="true" runat="server">
        <ContentTemplate> 
                 <div class="myformGrid">
                    <label>Busca por Garagem : </label>
                 <asp:DropDownList ID="ddlGaragem" AutoPostBack="true"  runat="server" CssClass="input"></asp:DropDownList>
                    <asp:Button ID="btnFiltrar" Text="Filtrar" runat="server"  onclick="btnFiltrar_Click" CssClass="button"  /> 
                    <asp:Button ID="btnNovo" Text="Novo" runat="server" onclick="btnNovo_Click"  CssClass="button"/>
                  </div>
                    <asp:GridView ID="gdvAutomovel" EmptyDataText="Nenhum Automóvel encontrado" 
                         runat="server" EnableModelValidation="True" 
                        onrowdatabound="gdvAutomovel_RowDataBound" AutoGenerateColumns="False" 
                        onrowcommand="gdvAutomovel_RowCommand">
                        <Columns>
                            <asp:BoundField DataField="AutomovelID" ItemStyle-Width="10px" HeaderText="Codigo" />
                            <asp:BoundField DataField="DescricaoGaragem" ItemStyle-Width="150px" HeaderText="Garagem" />
                            <asp:BoundField DataField="DescricaoMarca" ItemStyle-Width="150px" HeaderText="Marca" />
                            <asp:BoundField DataField="DescricaoModelo" ItemStyle-Width="200px" HeaderText="Modelo" />
                            <asp:BoundField DataField="Descricao" ItemStyle-Width="300px" HeaderText="Descrição" />
                            <asp:BoundField DataField="AnoModelo" ItemStyle-Width="90px" HeaderText="Ano Modelo" />
                            <asp:BoundField DataField="AnoFabricacao" ItemStyle-Width="90px" HeaderText="Ano Fabricação" />
                            <asp:TemplateField HeaderText="Preço" ItemStyle-Width="150px">
                                <ItemTemplate>
                                    <asp:Label ID="lblPreco" runat="server" Text="00,00" ></asp:Label> 
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="" ItemStyle-Width="30px">
                                <ItemTemplate>
                                    <asp:ImageButton ID="imgEditar" CommandName="Editar" ImageUrl="~/Imagens/Editar.png" runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="" ItemStyle-Width="30px">
                                <ItemTemplate>
                                    <asp:ImageButton ID="imgExcluir" CommandName="Excluir" ImageUrl="~/Imagens/Excluir.png" runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
        </table>
        
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
